Logo pSolver pSolver

User Manual

Updated to version 4.26

Index

  1. Introduction
  2. User accounts
  3. Problem list
  4. Problem screen
  5. Problem components
  6. Problem solving
  7. Sections
  8. Solving a problem multiple times
  9. Numerical solution of differential/integral equations
  10. Mathematical expressions
  11. Correction by comparison
  12. Activities

Introduction

pSolver is an application designed to facilitate the resolution of numerical problems that usually arise in technical disciplines related to engineering.

Each of the problems handled by the application must contain the basic components needed to solve it. These components are:

  • Data
  • Unknowns
  • Equations

The application is able to solve a system of nonlinear equations, finding the values of the unknowns that satisfy these equations.

To add complementary information and anything else we want to include in the problem, we have two more components:

  • Texts
  • Images

The physical properties of the most common fluids and those of humid air (psychrometry) can be obtained with two components added to the application for this purpose:

  • Fluids
  • Humid Airs

In order to be able to analyze the results obtained by varying some of the input data, the application has two components called:

  • Tables
  • Graphs

All these components, which the user can create, move, edit, delete and copy/paste, help to solve the problem in an orderly fashion. In this way, the student can focus on the proper approach to the problem, without having to spend time and effort on mathematical resolution or searching for fluid properties in tables.

The application can be run in any latest generation browser by accessing the address http://psolver.org.

It is recommended to use Chrome, Safari or Microsoft Edge. With Firefox it is not allowed to use the system clipboard to copy and paste components, we can enable it by following the steps below:

  1. Type "about:config" in the Firefox navigation bar.
  2. Accept the "Accept risk and continue" message.
  3. Search for "dom.events.testing.asyncClipboard" and set it to "true".

Problems are automatically stored in an on-line database (Google Firebase).

User accounts

When we access the application for the first time, the following page appears, where we can choose the language with the drop-down menu in the upper left zone.

Starting page

By clicking on the buttons that appear we can perform the following actions:

  • Login: Log in with our already registered user.
  • Sign up: Allows to create a user account for the use of the application.

If we click on the sign up button, the following registration dialog will appear:

Sign up dialog

After filling in the fields with our data, the following informative message will be displayed:

verification email

To finish the registration process we must access our email, where we will receive a message with a link to verify our account, please note that sometimes the mail is classified as spam. Once this is done we will be able to log in with our email and password.

The login dialog is shown in the following image, and allows us, if we have forgotten the password, to sent an email to set a new password.

Login

The next time we access the application with the same computer and browser we will access directly without having to enter the user and password again. If we do not want this to happen, which is highly recommended if the computer is not ours, we must close the session before finishing.

The application allows you to make a problem without having any user by pressing the "Blank problem" button that appears in the startup window. We will be able to work normally with the problem but nothing will be saved in the database. If we use the "Problem with known ID" button, it will ask us for the ID (it is an identifying number of the problem that we will see later on how to obtain) of an existing problem and will allow us to work with it, but as before, it will not save any of the modifications that we make. It is also possible to work without a registered user by loading a problem from a local file (stored on the user's computer).

In the case of working on a problem without being logged as a user we will find in the upper right part of the button bar the button which allows us to save the current problem to the local disk (json format is used).

When we create a new account the user type will be "Standard (student)" with a maximum number of 50 problems. If you want to change your user type to "Teacher" or to increase the maximum number of problems, you have to write an email to psolver@psolver.org requesting it.

Problem list

After logging into our account we are shown the following screen where we can see our problem list.

Problem list

This screen is where the user's problems are managed. We can create a new problem using button.

For each of the problems, a check box is shown on the left to select it and on the right icon allows you to load the problem to work with. If we select a problem using the check we can delete or duplicate it using the icons above the list.

The list of problems can be sorted according to different criteria (Date modified, category or name) using the drop-down list. The category of each problem is displayed as a different coloured label.

The "Filter" drop-down menu allows you to filter by category, so that only the problems of the categories selected by the user will be shown in the list, or to make a filter according to the type of problems: regular, statement or activity (see section "Activities").

The other buttons have the following functions:

  • : User configuration, allows the name to be changed.
  • : Log out user.
  • : New activity: Request the ID of a "Statement" by creating an activity from it (see section "Activities").
  • : Copy problem: Requests the ID of a problem and makes a copy of it in our account. Allowing to copy problems between different users.
  • : Download selected problems to a file: Backs up selected problems to a file (json format is used).
  • : Import problems from file: Upload the problem(s) from a local file to your account.
  • : Edit categories: Allows you to modify the name and/or colour of existing categories.

Problem screen

When we click on the arrow button on a specific problem we enter the problem screen.

The problem screen consists of 3 main zones:

  • The button bar in the upper area.
  • The central area, which represents our problem on paper, is where the different components created by the user will be placed.
  • A right side bar for editing components. Its content will change depending on the selected component.
Problem screen

To adjust the display parameters of the working screen we can use the button . The parameters we can modify are shown in the configuration sidebar and will be remembered by each of the different browsers we use. In addition to the width of the sidebar, its position, the zoom of the page and its position, we can modify the "Mouse step" in pixels that allows us to move the components in jumps of that size, facilitating their positioning and alignment. We can also change the white background of the page to a grid or dotted background. Finally, we can change the colour of the text used for the different components: data, unknowns, etc. components: data, unknowns, equations, properties of fluids or humid air, the labels of the images, tables and graphs, and the "non-active" components.

Configuration

In the upper area, outside the paper, we can see the name of the problem, its category and its description. If we click on the name it will appear in the editing sidebar the general problem properties, as shown in the following figure:

Problem properties

Using this bar we can change the name, description, category and page size/orientation of the pages. With the "private" check we block the problem, so that the problem cannot be seen or copied by others. We can convert the problem into a "Statement" to be sent to the students, only for "Teacher" users (see "Activities" section).

If we want to create a new type of category we must do it using the drop-down menu "Create new category", where we can choose a name and colour of the category and then click on the "Add" button.

Create new category

In the drop-down menu "Numerical format" we can modify the number of significant figures to be used in this problem, by default value is 4. Also configurable are the value below which it will be rounded to zero, and the minimum and maximum values to change the notation from decimal (the point is used as decimal separator) to exponential or scientific notation.

Numerical format

We can also see the dates of creation and last modification of the problem and the problem ID. The ID is a combination of letters and numbers that uniquely identifies the problem and which can be copied to send the problem to another user. The e-mail of the original author of the problem corresponds to the user who created the problem. This e-mail will be kept when we make copies of the problem.

In addition to the configuration button we can see the "New" drop-down menu that allows us to create each of the different components of a problem (details in the next section). Next we find the buttons for editing the components of the problem:

  • Delete: Deletes the selected component(s).
  • Activate/deactivate: Activates or deactivates the selected components.
  • Send to the back: When two components occupy the same space on the sheet, we can send the selected component to the background.
  • Cut: Remove and saves the currently selected components to the clipboard so that they can be pasted later. They can be pasted into the same problem or into another problem.
  • Copy: Saves the currently selected components to the clipboard so that they can be pasted later. They can be pasted into the same problem or into another problem.
  • Paste: Paste the components previously stored in the clipboard into the problem, the user must click on the new place where he/she wants to paste the components.
  • Replace symbol: Replace a symbol with other entered by the user, searching all components of the problem.
  • Search for unknowns: Review the equations and create the new unknowns found in them.
  • Tabular view: Displays several lists of the main components (data, unknowns, equations, fluids and humid airs) in tabular format.

Finally, we can find the buttons related to the resolution and management of the problem:

  • Solve: Solve the problem by calculating the unknowns.
  • Results to initial values: It takes as initial values for the resolution the results currently calculated. This option, as we will see later on, is very interesting when problems of convergence arise in the resolution of the problem.
  • Comparative correction: This option allows us to correct our problem by comparing it with another problem that should be correct. You can find a section on the subject below.

The final area on the right hand side of the button bar contains a label with the name of the registered user and button in teh left hand side to return to the problem list or the initial registration screen.

You can select multiple components by holding down ctrl (cmd on MacOS) and apply the action to all components. You can also select multiple components by clicking and dragging the mouse while holding down the ctrl key (cmd on MacOS), a box with a dashed border will appear.

Problem components

Text: This component allows us to insert a text box. Texts can be formatted using "Markdown". This link briefly describes what Markdown is and how to use it. In the following link you can see an example with all the formatting possibilities that Markdown offers within pSolver: Problem with Markdown text examples.

Text edit

Data: This component is used to enter the known data at the beginning of the problem. The data symbol is the mathematical name of the data and is formatted using AsciiMath as are the equations, fluid properties and unknowns. A brief description of how to use this mathematical format is given in the section Mathematical expressions. The data value can be a number, an expression with numbers, an expression containing other previous data, or a text string if enclosed in inverted commas, e.g. "Water". This type of string data can be used for fluids as we will see later.

The "Active" option that appears in many components may not be selected, and in that case the program would not take that component into account when solving the problem. As we will see, deactivating a component so that the application does not use it in its resolution process can help to perform an orderly resolution of the problem and thus improve the convergence of the resolution.

The "Border" option places a border line around the component. check box locks the component, preventing it from being modified or deleted. Locked components can only be repositioned.

We can change the unit of the data by using the "Change unit" drop-down where we enter the final unit and the mathematical expression to perform the unit change (the data in this expression will always be called "x"). Finally, the bottom button allows us to convert the data into an unknown.

Data edit

Unknown: This component is used to create the unknowns of our problem whose value will be obtained by the application when solving a set of equations. The unknowns may be automatically created by the application if we use the "find unknowns" button in the toolbar.

If, once the result has been obtained, we want to change the unit of the unknown, we can do this using the drop-down menu "Change of unit" where we introduce the final unit and the mathematical expression to make the unit change (the unknown in this expression will always be called "y").

The "Convergence parameters" drop-down will be discussed later in the section on convergence of results. We can also find a button to convert the unknown to a data.

Unknown edit

Equation: This is the component with which the user can define the equations of his problems. The equations must be written in AsciiMath format and must contain a single equal sign "=". In the section "Mathematical expressions" you can find a summary of how the expressions present in the application are evaluated.

Equation edit

Images: Component that allows the insertion of images that are accessible on the internet. The size of the images is controlled by the "Width" property which defines the % of the page width that the image should occupy.

The three options for inserting images are chosen in the "Type" property:

  • URL address: For this option in the "link" we must include the URL address where the image we want to show is located.
  • Google Drive: If the image is in our Google Drive we must share it and put the option "Anyone with the link can see the image". Copy the link provided by Google Drive and paste it into the "link" field.
  • Dropbox: In the case of having the image stored in Dropbox, from Dropbox we create a link so that "Anyone who has the link can see the file". We copy the link provided by Dropbox and paste it into the "link" property.
Image edit

Fluids: Este componente permite obtener las propiedades físicas de muchos fluidos a través del uso de la librería Coolprop. Para obtener una propiedad es necesario definir un símbolo, seleccionar el fluido y facilitar el valor de dos propiedades físicas del mismo. Estos valores pueden ser números, datos, incógnitas o expresiones matemáticas que combinen los componentes anteriores. FLuid: This component allows the physical properties of many fluids to be obtained through the use of the Coolprop library. To obtain a property, it is necessary to define a symbol, select the fluid and provide the value of two of its physical properties. These values can be numbers, data, unknowns or mathematical expressions that combine the above components.

In the list of available fluids will appear all the fluids provided by the Coolprop library plus all the string data that exist in the problem, for example if we have a data f = "Water", f will appear at the end of the list. Thus changing the value of the data we will change the fluid used automatically, if we use string data we can use as fluid name, in addition to the ones listed in the dropdown, the names used by Coolprop for fluids and incompressible fluids.

Fluid edit

Humid air: This component makes it possible to obtain the psychrometric properties of humid air, for which it also uses the Coolprop library. In this case the properties to be supplied are three instead of two. We can apply a unit change to both fluids and humid air, providing the final unit and the expression as a function of "x".

Humid air edit

Tables: Tables are components that allow the problem to be solved several times by changing the data value for each row of the table. Tables are discussed in more detail in the section "Solving the problem multiple times".

Graphs: Graphs allow you to represent using line graphs the values obtained with the tables. We will see them in more detail in the section "Solving the problem multiple times".

Sections: This component allows the problem to be divided into independent parts (sections) as if it were different subproblems. In this way, we can change the value of the data and the unknowns using the same symbols in different sections of the same problem. It will be explained in more detail in the section "Sections".

Quick edit

For texts, data, unknowns and equations you can use the quick (in situ) editing of the component. Double-clicking or pressing "Enter" on a selected component activates the in-place editing of the component. It consists of a text box just below the component that the user can edit by pressing "Enter" or "Escape" to finish the editing.

In the case of data, as we can see in the following image, the symbol, an equal, the value or expression of the data and the units between brackets are shown. The user can modify any of the three fields and press Enter to finish. In the case of Text, to exit the edition process, press Escape, since Enter is used to enter a new line in the text.

Edicion rapida

Tabular view

Using button we access the tabular view of the problem.

Problem tabular view

This screen will display a list of the data, unknowns, equations, fluids or humid airs present in our problem, depending on what is selected in the drop-down list on the top left.

This option is designed to be able to check carefully all the components of our problem. If any component has an error, the first field will appear in red. Within this screen we can only delete the component by clicking on the word "Delete" in the Action column or edit the component by clicking on its row (the editing sidebar is the same as the one in the main screen).

Problem solving

To solve the problem, click on the "solve" button , the application checks if the number of equations is equal to the number of unknowns. Sometimes it is not able to obtain a solution and displays a message similar to the following:

Convergence error dialog

For example, if we try to solve the equation ln(0.5 - x ) = 1, we do not obtain a solution because the iterative process of solving begins by evaluating the two members of the equation with some initial values, which in this case is x = 1. When we try to calculate the neperian logarithm of 0.5 - 1 = -0.5 we obtain an error (as we know the neperian logarithm of a negative number does not exist).

In order to solve this we must change the initial value of x. In the drop-down "Convergence parameters" that appears in the edition of the unknowns and fluids. In this drop-down we can change the initial value, the minimum value and the maximum value, thus helping the convergence process to find a solution. In our previous case, if we set the initial value to "-1" we can see how it finds a solution.

When convergence problems appear, the initial values of the unknowns must be revised. A good option is to solve the equations in blocks and take the results obtained as initial values, using the button "results to initial values".

Editar parámetros de convergencia

Sections

When we add a component section we can see the text "End Section: n" and a horizontal line that we can place at the height we want marking the division between the different sections of the problem. When we click on any component or free area of the paper we can see a label in the upper area that shows us the current section, which will be the one we can solve.

This component allows having data, unknowns and fluids with the same symbol in the different sections of the problem, and thus being able to solve different subproblems within the same problem.


Problem with sections

By clicking on the section label at the top right, we can make the section global. Global sections are labelled in red and (G) is added to distinguish them.

All the data, unknowns, equations, fluids and humid airs from global sections will be included in all the other sections when we proceed to solve them. If we have components common to all the sections, the most appropriate way to do it is to create a global section and put them all in it.


Global section example

Solving a problem multiple times

In what has been described so far in the manual we have explained how to solve a given problem only once. To solve the given problem several times, the "Table" component must be used.

The first step before creating a table is to create a problem and solve it with some initial values of the data that we can then vary using the table. After creating the table, in addition to defining the number of rows (number of times the problem will be solved) and the number of columns, we must define what each of the columns will contain.

Table edit

In each of the columns we must write the symbol of one of the data, unknowns, fluid or humid air of our problem. Only for the data we can add a symbol = and an expression to define how much these data are worth for each of the rows of the table. If the symbol of our data were T_1, the possibilities would be the following:

  • T_1 : For all rows the data T_1 is worth the value specified in its definition, in this case 10.
  • T_1 = 25 : For all the rows the data T_1 is 25. We could also put an expression depending on the variables of the problem, for example, T_1 = T_2 / 10, it would take as value of T_1 the calculation of T_2/10, that is to say 2, and it would use it for all the rows.
  • T_1 = 10, 12, 14, 15, 18 : Comma separated values are used in order for each of the rows in the table. If the number of rows is greater than the number of values specified, the last one will be repeated until the end of the rows. As shown in the next section, in this case we can put as the first value an expression calculated using the variables of the problem and from the second value the expression is evaluated with the values of the problem in the previous row.
  • T_1 = 10 -> 50 : The value of the first row is 10 and the value of the last row is 50 and the intermediate values are calculated by linear interpolation. Both 10 and 50 could be an expression of variables in the problem.
  • T_1 = 10 @ 5 : The value of the first row is 10 and the following rows are incremented by 5. For this example, the values would be 10, 15, 20, 25, and 30. Both 10 and 5 could be an expression of problem variables.

Once all the columns have been defined, click on the "Calculate" button to obtain the values of all the rows, solving the problem as many times as we have rows. The button "Export to CSV" allows us to export the values of the table to a file that we can later use in our computer.

After creating a table, it is possible to create a "Graph" component to represent some of the columns of the table. The width of the chart is specified as a percentage of the page width. And for each of the data series that we want to represent, in the "Data table" drop-down menu we must choose which table contains the data of that series.

In the "AXES" area we have properties to name the axes and specify their minimum and maximum values. And in the "SERIES" area we define how many data series we want to plot, introducing the name of each series, the symbol that will be used as "x" in the graph and the one that will be used as "y". The "Colour", "Symbol" and "Line" properties allow us to customise the appearance of the representation of each of the series, being able to use a secondary axis for the "y".

Graph edit

Numerical solution of differential/integral equations

Using the table component we can numerically solve differential/integral equations. For this purpose, the possibility has been implemented that the data can be defined according to variables calculated in the previous row of the table.

To explain this utility we will use a simple example of the calculation of the position in a movement with constant acceleration. When assembling the table we define the data using expressions from the previous row:


Differential equation problem

As we can see, we calculate the final position and velocity of an instant from the initial velocity and position:

  • t = t, Deltat : The first value will be t (0 s) and the step Deltat (1 s)
  • v_i = v_i, v_f : The data v_i (initial velocity) will be worth v_i (0 m/s according to the problem) for the first row and "v_f" (final velocity) for the following rows, v_f will be taken from the previous row.
  • x_i = x_i, x_f : The data x_i (start position) shall be worth x_i (0 m according to the problem) for the first row and "x_f" (end position) for the following rows, x_f shall be taken from the previous row.

Differential equation table

With this utility, differential and/or integral problems can be solved. This type of problem often appears in the dynamic behaviour of time-varying problems or in spatial problems solved by finite elements or finite differences.

Mathematical expressions

The mathematical expressions that we write in data, equations, fluids and humid airs, are evaluated using the library expr-eval.

In the web page of this library we can find a section called "Expression Syntax" where it is described how expressions must be written to be processed correctly.

Variable names must be character strings (case sensitive) without any spaces. To use subscripts use "_". "pi" and "e" are two preloaded numeric constants and must not be used as variable names.

Operator precedence

Operator Description
(...) Group
! Factorial
^ Exponentiation
*, /, % Multiplication, division, remainder
+, - Addition, subtraction
==, !=, >=, <=, >, < Equal, not equal, greater than or equal to, less than or equal to, greater than, less than
and logical AND
or logical OR

Functions

The functions shown in the table below are the most common predefined functions.

Function Description
abs(x) Absolute value of x
acos(x) Arc cosine of x (in radians)
acosh(x) Arc hyperbolic cosine of x (in radians)
asin(x) Arc sine of x (in radians)
asinh(x) Arc hyperbolic sine of x (in radians)
atan(x) Arc tangent of x (in radians)
atanh(x) Arc hyperbolic tangent of x (in radians))
cbrt(x) Cubic root of x
ceil(x) The smallest integer that is >= x
cos(x) cosine of x (x in radians)
cosh(x) hyperbolic cosine of x (x in radians)
exp(x) eexponential of x, is equal to e^x
floor(x) The largest integer that is <= x
ln(x) Neperian logarithm of x
log(x) Neperian logarithm of x, equals ln(x)
log10(x) Decimal logarithm of x
log2(x) Logarithm in base 2 of x
round(x) Round x to the nearest integer
sign(x) Sign of x (-1, 0, or 1 for negative, zero or positive x respectively)
sin(x) Sine of x (x in radians)
sinh(x) Hyperbolic sine of x (x in radians)
sqrt(x) Square root of x
tan(x) Tangent of x (x in radians)
tanh(x) Hyperbolic tangent of x (x in radians)
random(n) Random number between [0, n)
min(a,b,…) Minimum of a series of values (a,b,...)
max(a,b,…) Maximum of a series of values (a,b,...)
if( x>0, v1, v2) First parameter is evaluated, if it is true returns v1 and if it is false returns v2. Example: if( x>8 , 1 , 0) = 1 ; (x = 10)
at(x,[l1,l2],[v1,v2,v3]) x is evaluated, if x <= l1 returns v1, if x > l1 and x <= l2 returns v2 ,and if x > l2 returns v3.

Correction by comparison

We will explain the use of this option on an example problem in which water is heated by adding heat at constant pressure, in the following figure we can see the problem done by a student:

Example problem to be corrected

Usin button we can correct our problem by comparing it with another problem that may be the correct one. In the upper field we enter the ID of the correct problem and click on the correct button.

The table will list the variables (data, unknowns, fluids and humid airs) of the correct problem and compare them with the variables of the proper problem. The variables of the correct problem have two levels: Principal and Secondary. The primary variables are the fundamental unknowns of the problem and are marked in the correct problem by putting a border around them.

The "Show" filter allows us to keep only the primary variables.

Correction screen

The last column shows the result of the comparison:

  • The variable was found and its result is correct (same as the correct problem).
  • The variable was found but its result does not match the correct one.
  • No variable with that name is found in the problem.

In our example in the figure we can see that we have two errors, firstly that the variable with the volumetric flow rate in the correct problem is called "dotV_e" and ours probably has another name (in this case "V_e"). The second error is that the data "Q" is 20 kW in our problem and the correct one is 21 kW, this makes that both "h_s" and "T_s" that are results of the resolution are also wrong. We would have to go back to our problem and change the value of "Q".

Once these two changes have been made and we go back to solving the problem, we can see that all the variables of our problem are correct.

Correct variables

Activities

Activities are a type of problem designed to be sent to students for them to complete individually. They can therefore be used to set homework or take exams.

In order to submit an activity, we must create a problem and select the "Statement" checkbox in the general properties of the problem. It is usual to include only a text with the problem statement and those data/unknowns that we want to provide the student with. Only users of type "Teacher" will be able to create statements.

So that the student can carry out our activity, we will send the id of the statement to the students and they will have to use "New activity" buttom entering the id of the statement. An activity will be created in the student's account with the following particularities:

  • It only allows copy/paste components from the same activity.
  • Copying and viewing of the activity by third parties is not permitted (private problem).
  • At the top of the problem there is a description of whether the activity is delivered or not, and if so, the delivery date.
  • To the right of the problem name there is a link to submit the problem. After submitting the problem, none of the changes made by the student will be saved. That is, the problem will appear in the state in which it was submitted each time it is reopened.

Example of an undelivered activity
Example of delivered activity

The author of the statement will be able to see the list of activities copied from his/her statement, or in other words, the list of activities done by the students. The teacher will be able to view and modify each of the activities made by the students and linked to their statement, using the button " " that will appear in all the statements.


Activity in list

The list of the activities carried out by the students will appear in a table like the one in the following figure. With the link "Go prob." you can view and modify the student's problem.

If we enter the correct problem ID and click on the "correct" button, we will be able to see the values that appear in the correction columns for all the students' activities. In these columns the results will appear only for the main variables, showing whether they are correct, incorrect or not found.


Activity list

pSolver :: User group :: twitter